using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsDesktopTools._SummarizeData
{
    /// <summary>
    /// <para>Reconstruct Tracks</para>
    /// <para>Creates line or polygon tracks from time-enabled input data.</para>
    /// <para>根据启用时间的输入数据创建线或面轨迹。</para>
    /// </summary>    
    [DisplayName("Reconstruct Tracks")]
    public class ReconstructTracks : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ReconstructTracks()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_layer">
        /// <para>Input Layer</para>
        /// <para>The points or polygons to be reconstructed into tracks. The input must be a time-enabled layer that represents an instant in time.</para>
        /// <para>要重构为轨迹的点或多边形。输入必须是表示时间瞬间的启用时间的图层。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>A new feature class with the resulting tracks.</para>
        /// <para>包含生成轨迹的新要素类。</para>
        /// </param>
        /// <param name="_track_fields">
        /// <para>Track Fields</para>
        /// <para>One or more fields that will be used to identify unique tracks.</para>
        /// <para>将用于标识唯一轨迹的一个或多个字段。</para>
        /// </param>
        /// <param name="_method">
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the criteria that will be used to reconstruct tracks. If a buffer is used, the Method parameter determines the type of buffer.</para>
        ///   <bulletList>
        ///     <bullet_item>Geodesic— If the spatial reference can be panned, tracks will cross the date line when appropriate. If the spatial reference cannot be panned, tracks will be limited to the coordinate system extent and may not wrap.</bullet_item><para/>
        ///     <bullet_item>Planar—Planar buffers will be created.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于重建轨道的条件。如果使用缓冲区，则 Method 参数确定缓冲区的类型。</para>
        ///   <bulletList>
        ///     <bullet_item>测地线 - 如果可以平移空间参考，则轨迹将在适当时穿过日期变更线。如果无法平移空间参考，则轨迹将被限制在坐标系范围内，并且可能无法换行。</bullet_item><para/>
        ///     <bullet_item>Planar—将创建平面缓冲区。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public ReconstructTracks(object _input_layer, object _out_feature_class, List<object> _track_fields, _method_value _method)
        {
            this._input_layer = _input_layer;
            this._out_feature_class = _out_feature_class;
            this._track_fields = _track_fields;
            this._method = _method;
        }
        public override string ToolboxName => "GeoAnalytics Desktop Tools";

        public override string ToolName => "Reconstruct Tracks";

        public override string CallName => "gapro.ReconstructTracks";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "parallelProcessingFactor", "workspace"];

        public override object[] ParameterInfo => [_input_layer, _out_feature_class, _track_fields, _method.GetGPValue(), _buffer_type.GetGPValue(), _buffer_field, _buffer_expression, _time_split, _distance_split, _time_boundary_split, _time_boundary_reference, _summary_fields, _split_expression, _split_type.GetGPValue()];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The points or polygons to be reconstructed into tracks. The input must be a time-enabled layer that represents an instant in time.</para>
        /// <para>要重构为轨迹的点或多边形。输入必须是表示时间瞬间的启用时间的图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_layer { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>A new feature class with the resulting tracks.</para>
        /// <para>包含生成轨迹的新要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Track Fields</para>
        /// <para>One or more fields that will be used to identify unique tracks.</para>
        /// <para>将用于标识唯一轨迹的一个或多个字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Track Fields")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _track_fields { get; set; }


        /// <summary>
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the criteria that will be used to reconstruct tracks. If a buffer is used, the Method parameter determines the type of buffer.</para>
        ///   <bulletList>
        ///     <bullet_item>Geodesic— If the spatial reference can be panned, tracks will cross the date line when appropriate. If the spatial reference cannot be panned, tracks will be limited to the coordinate system extent and may not wrap.</bullet_item><para/>
        ///     <bullet_item>Planar—Planar buffers will be created.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于重建轨道的条件。如果使用缓冲区，则 Method 参数确定缓冲区的类型。</para>
        ///   <bulletList>
        ///     <bullet_item>测地线 - 如果可以平移空间参考，则轨迹将在适当时穿过日期变更线。如果无法平移空间参考，则轨迹将被限制在坐标系范围内，并且可能无法换行。</bullet_item><para/>
        ///     <bullet_item>Planar—将创建平面缓冲区。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _method_value _method { get; set; }

        public enum _method_value
        {
            /// <summary>
            /// <para>Geodesic</para>
            /// <para>Geodesic— If the spatial reference can be panned, tracks will cross the date line when appropriate. If the spatial reference cannot be panned, tracks will be limited to the coordinate system extent and may not wrap.</para>
            /// <para>测地线 - 如果可以平移空间参考，则轨迹将在适当时穿过日期变更线。如果无法平移空间参考，则轨迹将被限制在坐标系范围内，并且可能无法换行。</para>
            /// </summary>
            [Description("Geodesic")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar—Planar buffers will be created.</para>
            /// <para>Planar—将创建平面缓冲区。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

        }

        /// <summary>
        /// <para>Buffer Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the buffer distance will be defined.</para>
        ///   <bulletList>
        ///     <bullet_item>Field—A single field will be used to define the buffer distance.</bullet_item><para/>
        ///     <bullet_item>Expression—An equation using fields and mathematical operators will be used to define the buffer distance.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何定义缓冲区距离。</para>
        ///   <bulletList>
        ///     <bullet_item>字段 - 将使用单个字段来定义缓冲区距离。</bullet_item><para/>
        ///     <bullet_item>表达式 - 将使用字段和数学运算符的方程来定义缓冲区距离。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Buffer Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _buffer_type_value? _buffer_type { get; set; } = null;

        public enum _buffer_type_value
        {
            /// <summary>
            /// <para>Field</para>
            /// <para>Field—A single field will be used to define the buffer distance.</para>
            /// <para>字段 - 将使用单个字段来定义缓冲区距离。</para>
            /// </summary>
            [Description("Field")]
            [GPEnumValue("FIELD")]
            _FIELD,

            /// <summary>
            /// <para>Expression</para>
            /// <para>Expression—An equation using fields and mathematical operators will be used to define the buffer distance.</para>
            /// <para>表达式 - 将使用字段和数学运算符的方程来定义缓冲区距离。</para>
            /// </summary>
            [Description("Expression")]
            [GPEnumValue("EXPRESSION")]
            _EXPRESSION,

        }

        /// <summary>
        /// <para>Buffer Field</para>
        /// <para>The field that will be used to buffer the input features. Field values are applied in the units of the spatial reference of the input unless you are using a geographic coordinate system, in which case they will be in meters.</para>
        /// <para>将用于缓冲输入要素的字段。字段值将以输入的空间参考单位应用，除非您使用的是地理坐标系，在这种情况下，字段值将以米为单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Buffer Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _buffer_field { get; set; } = null;


        /// <summary>
        /// <para>Buffer Expression</para>
        /// <para><xdoc>
        ///   <para>The expression that will be used to buffer input features. Fields must be numeric, and the expression can include [+ - * / ] operators and multiple fields. Calculated values are applied in the units of the spatial reference of the input unless you are using a geographic coordinate system, in which case they will be in meters.</para>
        ///   <para>Use Arcade expressions such as as_kilometers($feature.distance) * 2 + as_meters(15).</para>
        ///   <para>If the layer is added to the map, the Fields and Helpers filters can be used to build an expression.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于缓冲输入要素的表达式。字段必须是数字，表达式可以包括 [+ - * / ] 运算符和多个字段。计算值将以输入的空间参考单位应用，除非您使用的是地理坐标系，在这种情况下，它们将以米为单位。</para>
        ///   <para>使用 Arcade 表达式，例如 as_kilometers（$feature.distance） * 2 + as_meters（15）。</para>
        ///   <para>如果将图层添加到地图中，则可以使用字段和帮助程序过滤器来构建表达式。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Buffer Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _buffer_expression { get; set; } = null;


        /// <summary>
        /// <para>Time Split</para>
        /// <para>Features that are farther apart in time than the time-split duration will be split into separate tracks.</para>
        /// <para>时间相距比时间分割持续时间更远的要素将被分割到单独的轨道中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Split")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_split { get; set; } = null;


        /// <summary>
        /// <para>Distance Split</para>
        /// <para>Features that are farther apart in distance than the distance split value will be split into separate tracks.</para>
        /// <para>距离远于距离分割值的要素将被分割到单独的轨迹中。</para>
        /// <para>单位： Feet | Yards | Miles | NauticalMiles | Meters | Kilometers </para>
        /// </summary>
        [DisplayName("Distance Split")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _distance_split { get; set; } = null;


        /// <summary>
        /// <para>Time Boundary Split</para>
        /// <para>A time span to split the input data into for analysis. A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, and set the time boundary reference to January 1, 1980, tracks will be split at the beginning of every day.</para>
        /// <para>将输入数据拆分为以进行分析的时间跨度。时间边界允许您在定义的时间跨度内分析值。例如，如果使用 1 天的时间边界，并将时间边界参考设置为 1980 年 1 月 1 日，则将在每天开始时拆分轨道。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Split")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_split { get; set; } = null;


        /// <summary>
        /// <para>Time Boundary Reference</para>
        /// <para>The reference time used to split the input data into for analysis. Time boundaries will be created for the entire span of the data, and the reference time does not need to occur at the start. If no reference time is specified, January 1, 1970, is used.</para>
        /// <para>用于将输入数据拆分为用于分析的参考时间。将为数据的整个跨度创建时间边界，并且参考时间不需要在开始时出现。如果未指定参考时间，则使用 1970 年 1 月 1 日。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Reference")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_reference { get; set; } = null;


        /// <summary>
        /// <para>Summary Fields</para>
        /// <para><xdoc>
        ///   <para>The statistics that will be calculated on specified fields.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Count—The number of nonnull values. It can be used on numeric fields or strings. The count of [null, 0, 2] is 2.</bullet_item><para/>
        ///       <bullet_item>Sum—The sum of numeric values in a field. The sum of [null, null, 3] is 3.</bullet_item><para/>
        ///       <bullet_item>Mean—The mean of numeric values. The mean of [0, 2, null] is 1.</bullet_item><para/>
        ///       <bullet_item>Min—The minimum value of a numeric field. The minimum of [0, 2, null] is 0.</bullet_item><para/>
        ///       <bullet_item>Max—The maximum value of a numeric field. The maximum value of [0, 2, null] is 2.</bullet_item><para/>
        ///       <bullet_item>Standard Deviation—The standard deviation of a numeric field. The standard deviation of [1] is null. The standard deviation of [null, 1,1,1] is null.</bullet_item><para/>
        ///       <bullet_item>Variance—The variance of a numeric field in a track. The variance of [1] is null. The variance of [null, 1, 1, 1] is null.</bullet_item><para/>
        ///       <bullet_item>Range—The range of a numeric field. This is calculated as the minimum value subtracted from the maximum value. The range of [0, null, 1] is 1. The range of [null, 4] is 0.</bullet_item><para/>
        ///       <bullet_item>Any—A sample string from a field of type string.</bullet_item><para/>
        ///       <bullet_item>First—The first value of a specified field in a track.</bullet_item><para/>
        ///       <bullet_item>Last—The last value of a specified field in a track.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将对指定字段进行计算的统计信息。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>计数 - 非空值的数目。它可以用于数值字段或字符串。[null， 0， 2] 的计数为 2。</bullet_item><para/>
        ///       <bullet_item>总和 - 字段中数值的总和。[null， null， 3] 的总和为 3。</bullet_item><para/>
        ///       <bullet_item>均值 - 数值的平均值。[0， 2， null] 的平均值为 1。</bullet_item><para/>
        ///       <bullet_item>最小值 - 数值字段的最小值。[0， 2， null] 的最小值为 0。</bullet_item><para/>
        ///       <bullet_item>最大值 - 数值字段的最大值。[0， 2， null] 的最大值为 2。</bullet_item><para/>
        ///       <bullet_item>标准差 - 数值字段的标准差。[1] 的标准差为空。[null， 1,1,1] 的标准差为 null。</bullet_item><para/>
        ///       <bullet_item>方差 - 轨迹中数值字段的方差。[1] 的方差为 null。[null， 1， 1， 1] 的方差为 null。</bullet_item><para/>
        ///       <bullet_item>范围 - 数值字段的范围。这是通过从最大值中减去最小值来计算的。[0， null， 1] 的范围为 1。[null， 4] 的范围为 0。</bullet_item><para/>
        ///       <bullet_item>任意 - 字符串类型字段中的示例字符串。</bullet_item><para/>
        ///       <bullet_item>First - 轨迹中指定字段的第一个值。</bullet_item><para/>
        ///       <bullet_item>最后 （Last） - 轨迹中指定字段的最后一个值。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _summary_fields { get; set; } = null;


        /// <summary>
        /// <para>Split Expression</para>
        /// <para>An expression that splits tracks based on values, geometry or time values. Expressions that validate to true will be split.</para>
        /// <para>根据值、几何或时间值拆分轨迹的表达式。验证为 true 的表达式将被拆分。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Split Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _split_expression { get; set; } = null;


        /// <summary>
        /// <para>Split Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the track segment between two features is created when a track is split. The split type is applied to split expressions, distance splits, and time splits.</para>
        ///   <bulletList>
        ///     <bullet_item>Gap—No segment is created between the two features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Finish After—A segment is created between the two features that ends after the split.</bullet_item><para/>
        ///     <bullet_item>Start Before—A segment is created between the two features that ends before the split.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在分割轨迹时如何创建两个要素之间的轨迹段。拆分类型应用于拆分表达式、距离拆分和时间拆分。</para>
        ///   <bulletList>
        ///     <bullet_item>间隙 - 在两个要素之间未创建线段。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>完成后 - 在两个要素之间创建一个线段，该线段在分割后结束。</bullet_item><para/>
        ///     <bullet_item>开始时间 - 在两个要素之间创建一个线段，该线段在分割之前结束。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Split Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _split_type_value _split_type { get; set; } = _split_type_value._GAP;

        public enum _split_type_value
        {
            /// <summary>
            /// <para>Gap</para>
            /// <para>Gap—No segment is created between the two features. This is the default.</para>
            /// <para>间隙 - 在两个要素之间未创建线段。这是默认设置。</para>
            /// </summary>
            [Description("Gap")]
            [GPEnumValue("GAP")]
            _GAP,

            /// <summary>
            /// <para>Finish After</para>
            /// <para>Finish After—A segment is created between the two features that ends after the split.</para>
            /// <para>完成后 - 在两个要素之间创建一个线段，该线段在分割后结束。</para>
            /// </summary>
            [Description("Finish After")]
            [GPEnumValue("FINISH_LAST")]
            _FINISH_LAST,

            /// <summary>
            /// <para>Start Before</para>
            /// <para>Start Before—A segment is created between the two features that ends before the split.</para>
            /// <para>开始时间 - 在两个要素之间创建一个线段，该线段在分割之前结束。</para>
            /// </summary>
            [Description("Start Before")]
            [GPEnumValue("START_NEXT")]
            _START_NEXT,

        }

        public ReconstructTracks SetEnv(object extent = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, workspace: workspace);
            return this;
        }

    }

}